package com.LearnInWorld.es.pojo;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;

import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

@Data
@Document(indexName = "learninworld_courseinfo", type = "doc")
public class CourseInfo implements Serializable {

    @Id
    @Field(index = true, store = true, type = FieldType.Keyword)
    private Long id;//视频id

    @Field(index = true, store = true, type = FieldType.Keyword)
    private String sn;//课程编号

    @Field(index = true, store = true, type = FieldType.Text, analyzer = "ik_smart")
    private String name;//课程名称

    @Field(index = true, store = true, type = FieldType.Text,analyzer = "ik_smart")
    private String caption;//副标题

    @Field(index = true, store = true, type = FieldType.Keyword)
    private String videoId;//视频id

    @Field(index = true, store = true, type = FieldType.Long)
    private String moduleId;//模块id

    @Field(index = true, store = true, type = FieldType.Text, analyzer = "ik_smart")
    private String moduleName;//模块名称

    @Field(index = true, store = true, type = FieldType.Text)
    private String image;//课程图片

    @Field(index = true, store = true, type = FieldType.Text)
    private String images;//视频图片列表

    @Field(index = true, store = true, type = FieldType.Text, analyzer = "ik_smart")
    private String introduction;//视频介绍

    @Field(index = true,store = true,type = FieldType.Date)
    private Date courseUpTime;//上传日期

    @Field(index = true, store = true, type = FieldType.Keyword)
    private String pay;//是否付费

    @Field(index = true, store = true, type = FieldType.Double)
    private Long  price;//价格

    @Field(index = true, store = true, type = FieldType.Long)
    private Long categoryId;//分类id

    @Field(index = true, store = true, type = FieldType.Text, analyzer = "ik_smart")
    private String categoryName;//分类

    @Field(index = true, store = true, type = FieldType.Long)
    private Long commentNum;//评论次数

    @Field(index = true, store = true, type = FieldType.Text)
    private String videoUrl;//视频url
}
